package net.kehuilai.controller;

import net.kehuilai.SocketClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by genghz on 16/12/8.
 */
@RestController
public class ClientController {

    @Autowired
    private SocketClient client;

    @RequestMapping(value = "/send", method = RequestMethod.GET)
    public void send() {
        client.send("clientMsg", "client request");
    }

    @RequestMapping(value = "/sendSync", method = RequestMethod.GET)
    public Object sendSync() {
        return client.sendSync("clientMsg", "client sync request");
    }
}
